<template>
  <el-drawer v-model="props.show" class="jzt-drawer" :with-header="false" :size="props.size" :before-close="handelbeforeClose">
    <div class="head_title">
      <span>{{ props.title }}</span>
      <el-icon size="20" @click="handelbeforeClose"><CloseBold /></el-icon>
    </div>
    <div class="ccontent">
      <slot></slot>
    </div>
  </el-drawer>
</template>
<script setup>
import { defineProps, defineEmits } from "vue";
const emits = defineEmits(["close"]);
const props = defineProps({
  show: {
    type: Boolean,
    default: false
  },
  size: {
    type: String,
    default: "30%"
  },
  title: {
    type: String,
    default: ""
  }
});
const handelbeforeClose = () => {
  emits("close");
};
</script>
<style scoped lang="scss">
.ccontent {
  height: calc(100% - 30px);
  position: relative;
}
.head_title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  span {
    font-size: 18px;
    color: #131414;
    position: relative;
    margin-left: 20px;
  }
  span::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #007dff;
    margin-right: 10px;
    border-radius: 50%;
    position: absolute;
    left: -20px;
    top: 6px;
  }
  i {
    cursor: pointer;
  }
}
</style>
